const person = {
  name: 'tom',
  sayHi: function () {
    console.log(`hi, my name is ${this.name}`)
  },
  sayHello: () => {
    console.log(`hello, my name is ${this.name}`)
  },
  sayHiAsync: function () {
    const _this = this
    setTimeout(function () {
      // 就借用闭包的机制使用_this
      console.log(_this.name)
    }, 1000)
  },
  sayHelloAsync: function () {
    setTimeout(() => {
      console.log(this.name)
    }, 1000)
  }
}
person.sayHi()
// hi, my name is tom
person.sayHello()
// hello, my name is undefined
person.sayHiAsync()
// tom, 不重新指定this的话就是undefined了
person.sayHelloAsync()
// tom
